Integrand size = 18, antiderivative size = 247 \[ \int x^4 \left (a+b \sin \left (c+d x^2\right )\right )^2 \, dx=\frac {1}{10} \left (2 a^2+b^2\right ) x^5-\frac {a b x^3 \cos \left (c+d x^2\right )}{d}-\frac {3 b^2 x \cos \left (2 c+2 d x^2\right )}{32 d^2}+\frac {3 b^2 \sqrt {\pi } \cos (2 c) \operatorname {FresnelC}\left (\frac {2 \sqrt {d} x}{\sqrt {\pi }}\right )}{64 d^{5/2}}-\frac {3 a b \sqrt {\frac {\pi }{2}} \cos (c) \operatorname {FresnelS}\left (\sqrt {d} \sqrt {\frac {2}{\pi }} x\right )}{2 d^{5/2}}-\frac {3 a b \sqrt {\frac {\pi }{2}} \operatorname {FresnelC}\left (\sqrt {d} \sqrt {\frac {2}{\pi }} x\right ) \sin (c)}{2 d^{5/2}}-\frac {3 b^2 \sqrt {\pi } \operatorname {FresnelS}\left (\frac {2 \sqrt {d} x}{\sqrt {\pi }}\right ) \sin (2 c)}{64 d^{5/2}}+\frac {3 a b x \sin \left (c+d x^2\right )}{2 d^2}-\frac {b^2 x^3 \sin \left (2 c+2 d x^2\right )}{8 d} \]
1/10*(2*a^2+b^2)*x^5-a*b*x^3*cos(d*x^2+c)/d-3/32*b^2*x*cos(2*d*x^2+2*c)/d^ 2+3/2*a*b*x*sin(d*x^2+c)/d^2-1/8*b^2*x^3*sin(2*d*x^2+2*c)/d-3/4*a*b*cos(c) *FresnelS(x*d^(1/2)*2^(1/2)/Pi^(1/2))*2^(1/2)*Pi^(1/2)/d^(5/2)-3/4*a*b*Fre snelC(x*d^(1/2)*2^(1/2)/Pi^(1/2))*sin(c)*2^(1/2)*Pi^(1/2)/d^(5/2)+3/64*b^2 *cos(2*c)*FresnelC(2*x*d^(1/2)/Pi^(1/2))*Pi^(1/2)/d^(5/2)-3/64*b^2*Fresnel S(2*x*d^(1/2)/Pi^(1/2))*sin(2*c)*Pi^(1/2)/d^(5/2)
Time = 0.38 (sec) , antiderivative size = 234, normalized size of antiderivative = 0.95 \[ \int x^4 \left (a+b \sin \left (c+d x^2\right )\right )^2 \, dx=\frac {64 a^2 d^{5/2} x^5+32 b^2 d^{5/2} x^5-320 a b d^{3/2} x^3 \cos \left (c+d x^2\right )-30 b^2 \sqrt {d} x \cos \left (2 \left (c+d x^2\right )\right )+15 b^2 \sqrt {\pi } \cos (2 c) \operatorname {FresnelC}\left (\frac {2 \sqrt {d} x}{\sqrt {\pi }}\right )-240 a b \sqrt {2 \pi } \cos (c) \operatorname {FresnelS}\left (\sqrt {d} \sqrt {\frac {2}{\pi }} x\right )-240 a b \sqrt {2 \pi } \operatorname {FresnelC}\left (\sqrt {d} \sqrt {\frac {2}{\pi }} x\right ) \sin (c)-15 b^2 \sqrt {\pi } \operatorname {FresnelS}\left (\frac {2 \sqrt {d} x}{\sqrt {\pi }}\right ) \sin (2 c)+480 a b \sqrt {d} x \sin \left (c+d x^2\right )-40 b^2 d^{3/2} x^3 \sin \left (2 \left (c+d x^2\right )\right )}{320 d^{5/2}} \]
(64*a^2*d^(5/2)*x^5 + 32*b^2*d^(5/2)*x^5 - 320*a*b*d^(3/2)*x^3*Cos[c + d*x ^2] - 30*b^2*Sqrt[d]*x*Cos[2*(c + d*x^2)] + 15*b^2*Sqrt[Pi]*Cos[2*c]*Fresn elC[(2*Sqrt[d]*x)/Sqrt[Pi]] - 240*a*b*Sqrt[2*Pi]*Cos[c]*FresnelS[Sqrt[d]*S qrt[2/Pi]*x] - 240*a*b*Sqrt[2*Pi]*FresnelC[Sqrt[d]*Sqrt[2/Pi]*x]*Sin[c] - 15*b^2*Sqrt[Pi]*FresnelS[(2*Sqrt[d]*x)/Sqrt[Pi]]*Sin[2*c] + 480*a*b*Sqrt[d ]*x*Sin[c + d*x^2] - 40*b^2*d^(3/2)*x^3*Sin[2*(c + d*x^2)])/(320*d^(5/2))
Time = 0.46 (sec) , antiderivative size = 247, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.167, Rules used = {3884, 6, 2009}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int x^4 \left (a+b \sin \left (c+d x^2\right )\right )^2 \, dx\) |
\(\Big \downarrow \) 3884 |
\(\displaystyle \int \left (a^2 x^4+2 a b x^4 \sin \left (c+d x^2\right )-\frac {1}{2} b^2 x^4 \cos \left (2 c+2 d x^2\right )+\frac {b^2 x^4}{2}\right )dx\) |
\(\Big \downarrow \) 6 |
\(\displaystyle \int \left (x^4 \left (a^2+\frac {b^2}{2}\right )+2 a b x^4 \sin \left (c+d x^2\right )-\frac {1}{2} b^2 x^4 \cos \left (2 c+2 d x^2\right )\right )dx\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle \frac {1}{10} x^5 \left (2 a^2+b^2\right )-\frac {3 \sqrt {\frac {\pi }{2}} a b \sin (c) \operatorname {FresnelC}\left (\sqrt {d} \sqrt {\frac {2}{\pi }} x\right )}{2 d^{5/2}}-\frac {3 \sqrt {\frac {\pi }{2}} a b \cos (c) \operatorname {FresnelS}\left (\sqrt {d} \sqrt {\frac {2}{\pi }} x\right )}{2 d^{5/2}}+\frac {3 a b x \sin \left (c+d x^2\right )}{2 d^2}-\frac {a b x^3 \cos \left (c+d x^2\right )}{d}+\frac {3 \sqrt {\pi } b^2 \cos (2 c) \operatorname {FresnelC}\left (\frac {2 \sqrt {d} x}{\sqrt {\pi }}\right )}{64 d^{5/2}}-\frac {3 \sqrt {\pi } b^2 \sin (2 c) \operatorname {FresnelS}\left (\frac {2 \sqrt {d} x}{\sqrt {\pi }}\right )}{64 d^{5/2}}-\frac {3 b^2 x \cos \left (2 c+2 d x^2\right )}{32 d^2}-\frac {b^2 x^3 \sin \left (2 c+2 d x^2\right )}{8 d}\) |
((2*a^2 + b^2)*x^5)/10 - (a*b*x^3*Cos[c + d*x^2])/d - (3*b^2*x*Cos[2*c + 2 *d*x^2])/(32*d^2) + (3*b^2*Sqrt[Pi]*Cos[2*c]*FresnelC[(2*Sqrt[d]*x)/Sqrt[P i]])/(64*d^(5/2)) - (3*a*b*Sqrt[Pi/2]*Cos[c]*FresnelS[Sqrt[d]*Sqrt[2/Pi]*x ])/(2*d^(5/2)) - (3*a*b*Sqrt[Pi/2]*FresnelC[Sqrt[d]*Sqrt[2/Pi]*x]*Sin[c])/ (2*d^(5/2)) - (3*b^2*Sqrt[Pi]*FresnelS[(2*Sqrt[d]*x)/Sqrt[Pi]]*Sin[2*c])/( 64*d^(5/2)) + (3*a*b*x*Sin[c + d*x^2])/(2*d^2) - (b^2*x^3*Sin[2*c + 2*d*x^ 2])/(8*d)
3.1.18.3.1 Defintions of rubi rules used
Int[(u_.)*((v_.) + (a_.)*(Fx_) + (b_.)*(Fx_))^(p_.), x_Symbol] :> Int[u*(v + (a + b)*Fx)^p, x] /; FreeQ[{a, b}, x] && !FreeQ[Fx, x]
Int[((e_.)*(x_))^(m_.)*((a_.) + (b_.)*Sin[(c_.) + (d_.)*(x_)^(n_)])^(p_), x _Symbol] :> Int[ExpandTrigReduce[(e*x)^m, (a + b*Sin[c + d*x^n])^p, x], x] /; FreeQ[{a, b, c, d, e, m}, x] && IGtQ[p, 1] && IGtQ[n, 0]
Time = 0.28 (sec) , antiderivative size = 185, normalized size of antiderivative = 0.75
method | result | size |
parts | \(\frac {x^{5} a^{2}}{5}+b^{2} \left (\frac {x^{5}}{10}-\frac {x^{3} \sin \left (2 d \,x^{2}+2 c \right )}{8 d}+\frac {-\frac {3 x \cos \left (2 d \,x^{2}+2 c \right )}{32 d}+\frac {3 \sqrt {\pi }\, \left (\cos \left (2 c \right ) \operatorname {C}\left (\frac {2 x \sqrt {d}}{\sqrt {\pi }}\right )-\sin \left (2 c \right ) \operatorname {S}\left (\frac {2 x \sqrt {d}}{\sqrt {\pi }}\right )\right )}{64 d^{\frac {3}{2}}}}{d}\right )+2 a b \left (-\frac {x^{3} \cos \left (d \,x^{2}+c \right )}{2 d}+\frac {\frac {3 x \sin \left (d \,x^{2}+c \right )}{4 d}-\frac {3 \sqrt {2}\, \sqrt {\pi }\, \left (\cos \left (c \right ) \operatorname {S}\left (\frac {x \sqrt {d}\, \sqrt {2}}{\sqrt {\pi }}\right )+\sin \left (c \right ) \operatorname {C}\left (\frac {x \sqrt {d}\, \sqrt {2}}{\sqrt {\pi }}\right )\right )}{8 d^{\frac {3}{2}}}}{d}\right )\) | \(185\) |
default | \(\frac {\left (a^{2}+\frac {b^{2}}{2}\right ) x^{5}}{5}-\frac {b^{2} \left (\frac {x^{3} \sin \left (2 d \,x^{2}+2 c \right )}{4 d}-\frac {3 \left (-\frac {x \cos \left (2 d \,x^{2}+2 c \right )}{4 d}+\frac {\sqrt {\pi }\, \left (\cos \left (2 c \right ) \operatorname {C}\left (\frac {2 x \sqrt {d}}{\sqrt {\pi }}\right )-\sin \left (2 c \right ) \operatorname {S}\left (\frac {2 x \sqrt {d}}{\sqrt {\pi }}\right )\right )}{8 d^{\frac {3}{2}}}\right )}{4 d}\right )}{2}+2 a b \left (-\frac {x^{3} \cos \left (d \,x^{2}+c \right )}{2 d}+\frac {\frac {3 x \sin \left (d \,x^{2}+c \right )}{4 d}-\frac {3 \sqrt {2}\, \sqrt {\pi }\, \left (\cos \left (c \right ) \operatorname {S}\left (\frac {x \sqrt {d}\, \sqrt {2}}{\sqrt {\pi }}\right )+\sin \left (c \right ) \operatorname {C}\left (\frac {x \sqrt {d}\, \sqrt {2}}{\sqrt {\pi }}\right )\right )}{8 d^{\frac {3}{2}}}}{d}\right )\) | \(187\) |
risch | \(\frac {x^{5} a^{2}}{5}-\frac {3 i a b \sqrt {\pi }\, \operatorname {erf}\left (\sqrt {i d}\, x \right ) {\mathrm e}^{-i c}}{8 d^{2} \sqrt {i d}}+\frac {x^{5} b^{2}}{10}+\frac {3 b^{2} \sqrt {\pi }\, \sqrt {2}\, \operatorname {erf}\left (\sqrt {2}\, \sqrt {i d}\, x \right ) {\mathrm e}^{-2 i c}}{256 d^{2} \sqrt {i d}}+\frac {3 b^{2} \sqrt {\pi }\, \operatorname {erf}\left (\sqrt {-2 i d}\, x \right ) {\mathrm e}^{2 i c}}{128 d^{2} \sqrt {-2 i d}}+\frac {3 i a b \sqrt {\pi }\, \operatorname {erf}\left (\sqrt {-i d}\, x \right ) {\mathrm e}^{i c}}{8 d^{2} \sqrt {-i d}}-\frac {a b \,x^{3} \cos \left (d \,x^{2}+c \right )}{d}+\frac {3 a b x \sin \left (d \,x^{2}+c \right )}{2 d^{2}}-\frac {3 b^{2} x \cos \left (2 d \,x^{2}+2 c \right )}{32 d^{2}}-\frac {b^{2} x^{3} \sin \left (2 d \,x^{2}+2 c \right )}{8 d}\) | \(224\) |
1/5*x^5*a^2+b^2*(1/10*x^5-1/8/d*x^3*sin(2*d*x^2+2*c)+3/8/d*(-1/4/d*x*cos(2 *d*x^2+2*c)+1/8/d^(3/2)*Pi^(1/2)*(cos(2*c)*FresnelC(2*x*d^(1/2)/Pi^(1/2))- sin(2*c)*FresnelS(2*x*d^(1/2)/Pi^(1/2)))))+2*a*b*(-1/2/d*x^3*cos(d*x^2+c)+ 3/2/d*(1/2/d*x*sin(d*x^2+c)-1/4/d^(3/2)*2^(1/2)*Pi^(1/2)*(cos(c)*FresnelS( x*d^(1/2)*2^(1/2)/Pi^(1/2))+sin(c)*FresnelC(x*d^(1/2)*2^(1/2)/Pi^(1/2)))))
Time = 0.31 (sec) , antiderivative size = 216, normalized size of antiderivative = 0.87 \[ \int x^4 \left (a+b \sin \left (c+d x^2\right )\right )^2 \, dx=\frac {32 \, {\left (2 \, a^{2} + b^{2}\right )} d^{3} x^{5} - 320 \, a b d^{2} x^{3} \cos \left (d x^{2} + c\right ) - 60 \, b^{2} d x \cos \left (d x^{2} + c\right )^{2} - 240 \, \sqrt {2} \pi a b \sqrt {\frac {d}{\pi }} \cos \left (c\right ) \operatorname {S}\left (\sqrt {2} x \sqrt {\frac {d}{\pi }}\right ) - 240 \, \sqrt {2} \pi a b \sqrt {\frac {d}{\pi }} \operatorname {C}\left (\sqrt {2} x \sqrt {\frac {d}{\pi }}\right ) \sin \left (c\right ) + 15 \, \pi b^{2} \sqrt {\frac {d}{\pi }} \cos \left (2 \, c\right ) \operatorname {C}\left (2 \, x \sqrt {\frac {d}{\pi }}\right ) - 15 \, \pi b^{2} \sqrt {\frac {d}{\pi }} \operatorname {S}\left (2 \, x \sqrt {\frac {d}{\pi }}\right ) \sin \left (2 \, c\right ) + 30 \, b^{2} d x - 80 \, {\left (b^{2} d^{2} x^{3} \cos \left (d x^{2} + c\right ) - 6 \, a b d x\right )} \sin \left (d x^{2} + c\right )}{320 \, d^{3}} \]
1/320*(32*(2*a^2 + b^2)*d^3*x^5 - 320*a*b*d^2*x^3*cos(d*x^2 + c) - 60*b^2* d*x*cos(d*x^2 + c)^2 - 240*sqrt(2)*pi*a*b*sqrt(d/pi)*cos(c)*fresnel_sin(sq rt(2)*x*sqrt(d/pi)) - 240*sqrt(2)*pi*a*b*sqrt(d/pi)*fresnel_cos(sqrt(2)*x* sqrt(d/pi))*sin(c) + 15*pi*b^2*sqrt(d/pi)*cos(2*c)*fresnel_cos(2*x*sqrt(d/ pi)) - 15*pi*b^2*sqrt(d/pi)*fresnel_sin(2*x*sqrt(d/pi))*sin(2*c) + 30*b^2* d*x - 80*(b^2*d^2*x^3*cos(d*x^2 + c) - 6*a*b*d*x)*sin(d*x^2 + c))/d^3
\[ \int x^4 \left (a+b \sin \left (c+d x^2\right )\right )^2 \, dx=\int x^{4} \left (a + b \sin {\left (c + d x^{2} \right )}\right )^{2}\, dx \]
Result contains complex when optimal does not.
Time = 0.35 (sec) , antiderivative size = 207, normalized size of antiderivative = 0.84 \[ \int x^4 \left (a+b \sin \left (c+d x^2\right )\right )^2 \, dx=\frac {1}{5} \, a^{2} x^{5} - \frac {{\left (16 \, d^{3} x^{3} \cos \left (d x^{2} + c\right ) - 24 \, d^{2} x \sin \left (d x^{2} + c\right ) + 3 \, \sqrt {2} \sqrt {\pi } {\left ({\left (\left (i + 1\right ) \, \cos \left (c\right ) - \left (i - 1\right ) \, \sin \left (c\right )\right )} \operatorname {erf}\left (\sqrt {i \, d} x\right ) + {\left (-\left (i - 1\right ) \, \cos \left (c\right ) + \left (i + 1\right ) \, \sin \left (c\right )\right )} \operatorname {erf}\left (\sqrt {-i \, d} x\right )\right )} d^{\frac {3}{2}}\right )} a b}{16 \, d^{4}} + \frac {{\left (256 \, d^{4} x^{5} - 320 \, d^{3} x^{3} \sin \left (2 \, d x^{2} + 2 \, c\right ) - 240 \, d^{2} x \cos \left (2 \, d x^{2} + 2 \, c\right ) + 15 \cdot 4^{\frac {1}{4}} \sqrt {2} \sqrt {\pi } {\left ({\left (-\left (i - 1\right ) \, \cos \left (2 \, c\right ) - \left (i + 1\right ) \, \sin \left (2 \, c\right )\right )} \operatorname {erf}\left (\sqrt {2 i \, d} x\right ) + {\left (\left (i + 1\right ) \, \cos \left (2 \, c\right ) + \left (i - 1\right ) \, \sin \left (2 \, c\right )\right )} \operatorname {erf}\left (\sqrt {-2 i \, d} x\right )\right )} d^{\frac {3}{2}}\right )} b^{2}}{2560 \, d^{4}} \]
1/5*a^2*x^5 - 1/16*(16*d^3*x^3*cos(d*x^2 + c) - 24*d^2*x*sin(d*x^2 + c) + 3*sqrt(2)*sqrt(pi)*(((I + 1)*cos(c) - (I - 1)*sin(c))*erf(sqrt(I*d)*x) + ( -(I - 1)*cos(c) + (I + 1)*sin(c))*erf(sqrt(-I*d)*x))*d^(3/2))*a*b/d^4 + 1/ 2560*(256*d^4*x^5 - 320*d^3*x^3*sin(2*d*x^2 + 2*c) - 240*d^2*x*cos(2*d*x^2 + 2*c) + 15*4^(1/4)*sqrt(2)*sqrt(pi)*((-(I - 1)*cos(2*c) - (I + 1)*sin(2* c))*erf(sqrt(2*I*d)*x) + ((I + 1)*cos(2*c) + (I - 1)*sin(2*c))*erf(sqrt(-2 *I*d)*x))*d^(3/2))*b^2/d^4
Result contains complex when optimal does not.
Time = 0.30 (sec) , antiderivative size = 329, normalized size of antiderivative = 1.33 \[ \int x^4 \left (a+b \sin \left (c+d x^2\right )\right )^2 \, dx=\frac {1}{5} \, a^{2} x^{5} + \frac {1}{10} \, b^{2} x^{5} - \frac {3 \, \sqrt {2} \sqrt {\pi } a b \operatorname {erf}\left (-\frac {1}{2} i \, \sqrt {2} x {\left (\frac {i \, d}{{\left | d \right |}} + 1\right )} \sqrt {{\left | d \right |}}\right ) e^{\left (i \, c\right )}}{8 \, d^{2} {\left (\frac {i \, d}{{\left | d \right |}} + 1\right )} \sqrt {{\left | d \right |}}} - \frac {3 \, \sqrt {2} \sqrt {\pi } a b \operatorname {erf}\left (\frac {1}{2} i \, \sqrt {2} x {\left (-\frac {i \, d}{{\left | d \right |}} + 1\right )} \sqrt {{\left | d \right |}}\right ) e^{\left (-i \, c\right )}}{8 \, d^{2} {\left (-\frac {i \, d}{{\left | d \right |}} + 1\right )} \sqrt {{\left | d \right |}}} + \frac {3 i \, \sqrt {\pi } b^{2} \operatorname {erf}\left (-i \, \sqrt {d} x {\left (\frac {i \, d}{{\left | d \right |}} + 1\right )}\right ) e^{\left (2 i \, c\right )}}{128 \, d^{\frac {5}{2}} {\left (\frac {i \, d}{{\left | d \right |}} + 1\right )}} - \frac {3 i \, \sqrt {\pi } b^{2} \operatorname {erf}\left (i \, \sqrt {d} x {\left (-\frac {i \, d}{{\left | d \right |}} + 1\right )}\right ) e^{\left (-2 i \, c\right )}}{128 \, d^{\frac {5}{2}} {\left (-\frac {i \, d}{{\left | d \right |}} + 1\right )}} - \frac {{\left (-4 i \, b^{2} d x^{3} + 3 \, b^{2} x\right )} e^{\left (2 i \, d x^{2} + 2 i \, c\right )}}{64 \, d^{2}} + \frac {i \, {\left (2 i \, a b d x^{3} - 3 \, a b x\right )} e^{\left (i \, d x^{2} + i \, c\right )}}{4 \, d^{2}} + \frac {i \, {\left (2 i \, a b d x^{3} + 3 \, a b x\right )} e^{\left (-i \, d x^{2} - i \, c\right )}}{4 \, d^{2}} - \frac {{\left (4 i \, b^{2} d x^{3} + 3 \, b^{2} x\right )} e^{\left (-2 i \, d x^{2} - 2 i \, c\right )}}{64 \, d^{2}} \]
1/5*a^2*x^5 + 1/10*b^2*x^5 - 3/8*sqrt(2)*sqrt(pi)*a*b*erf(-1/2*I*sqrt(2)*x *(I*d/abs(d) + 1)*sqrt(abs(d)))*e^(I*c)/(d^2*(I*d/abs(d) + 1)*sqrt(abs(d)) ) - 3/8*sqrt(2)*sqrt(pi)*a*b*erf(1/2*I*sqrt(2)*x*(-I*d/abs(d) + 1)*sqrt(ab s(d)))*e^(-I*c)/(d^2*(-I*d/abs(d) + 1)*sqrt(abs(d))) + 3/128*I*sqrt(pi)*b^ 2*erf(-I*sqrt(d)*x*(I*d/abs(d) + 1))*e^(2*I*c)/(d^(5/2)*(I*d/abs(d) + 1)) - 3/128*I*sqrt(pi)*b^2*erf(I*sqrt(d)*x*(-I*d/abs(d) + 1))*e^(-2*I*c)/(d^(5 /2)*(-I*d/abs(d) + 1)) - 1/64*(-4*I*b^2*d*x^3 + 3*b^2*x)*e^(2*I*d*x^2 + 2* I*c)/d^2 + 1/4*I*(2*I*a*b*d*x^3 - 3*a*b*x)*e^(I*d*x^2 + I*c)/d^2 + 1/4*I*( 2*I*a*b*d*x^3 + 3*a*b*x)*e^(-I*d*x^2 - I*c)/d^2 - 1/64*(4*I*b^2*d*x^3 + 3* b^2*x)*e^(-2*I*d*x^2 - 2*I*c)/d^2
Timed out. \[ \int x^4 \left (a+b \sin \left (c+d x^2\right )\right )^2 \, dx=\int x^4\,{\left (a+b\,\sin \left (d\,x^2+c\right )\right )}^2 \,d x \]